<template>
  <view @click="searchClickHandler" class="container" :style="{'background-color':bgcolor}">
    <view class="box" :style="{'border-radius': radius+'px'}">
      <uni-icons type="search" size="17"></uni-icons>
      <text class="placeholder">搜索</text>
    </view>
  </view>
</template>

<script>
  export default {
    name: "my-search",
    data() {
      return {

      };
    },
    props: {
      bgcolor: {
        type: String,
        default: '#C00000'
      },
      radius: {
        type: Number,
        default: 18 //px
      }
    },
    methods: {
      searchClickHandler() {
        this.$emit('click');
      }
    }
  }
</script>

<style lang="scss" scoped>
  .container {
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 15px;

    .box {
      width: 100%;
      height: 36px;
      background-color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;

      .placeholder {
        margin-left: 10px;
        font-size: 18px;
      }
    }
  }
</style>
